<template>
    <van-swipe :autoplay="3000" indicator-color="white">
        <van-swipe-item v-for="(val, index) in banner" :key="index">
            <img :src="val.img" :alt="val.text" />
            <p>{{val.text}}</p>
        </van-swipe-item>
    </van-swipe>
</template>

<style scoped lang='stylus'  rel='stylesheet/stylus'>
    img
        width:100%
        height:240px
        object-fit:cover
    p
        position:absolute;
        color:#fff;
        background:#268e5d85;
        top:-15px;
        right:0;
        padding:5px 0;
        width:100%
</style>

<script>
import { Swipe, SwipeItem } from "vant";
export default {
    name:"swipe",
    components: {
        "van-swipe": Swipe,
        "van-swipe-item": SwipeItem
    },
    data: () => ({
        list: []
    }),
    props:{
        banner:Array
    }
};
</script>